package javabase.socket;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;

public class SocketClientTest {

    public static void main(String[] args) throws IOException {
        try (Socket socket = new Socket("127.0.0.1", 1000)) {
            BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));

            PrintWriter out = new PrintWriter(socket.getOutputStream(), true);

            out.println("hello");

            reader.readLine();
        }
    }

}
